<!DOCTYPE html>
<html>


<head>
    <!--引入公用模板-->
    <%- include ../taglib/layout-report.ejs %>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content" style="padding:5px">
    <div class="row animated fadeInDown">
            <div class="col-sm-12 " style="padding-left:15px;margin-top: 5px;margin-bottom: 0px">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>车辆离线统计</h5>
                            <div class="ibox-tools">
                                <a class="collapse-link">
                                    <i class="fa fa-chevron-up"></i>
                                </a>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <div class="row">
                                <form role="form" class="form-inline   pull-right" >

                                    <!--<button type="button" class="btn btn btn-primary" onclick="query()"><i-->
                                                <!--class="fa fa-search"></i> 搜索-->
                                    <!--</button>-->
                                    <button type="button" class="btn btn btn-primary" onclick="outexcel()"><i
                                                class="fa  fa-file-excel-o"></i> 导出
                                    </button>

                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                    <div class="col-sm-12 clearfix " style="padding-left:15px;margin-top: 0px;margin-bottom: 0px">
                        <div class="ibox float-e-margins" >
                            <div class="ibox-title">
                                <div>
                                    <h5>
                                        车辆离线列表
                                    </h5>
                                </div>
                                <div class="ibox-tools">
                                    <a class="collapse-link">
                                        <i class="fa fa-chevron-up"></i>
                                    </a>
                                </div>
                            </div>
                            <div class="ibox-content">
                                <div class="" id="">
                                    <div>
                                        <table id="example"
                                               class="table table-striped table-bordered table-hover dataTables-example">
                                            <thead>
                                            <tr>
                                                <!--<th>-->
                                                <!--</th>-->
                                                <th>id</th>
                                                <th width="400px">车牌号</th>
                                                <th width="300px">设备地址</th>
                                                <th width="300px">SIM</th>
                                                <!--<th>设备编号</th>-->
                                                <!--<th>SIM卡号</th>-->
                                                <!--<th>安装时间</th>-->
                                                <!--<th>到期时间</th>-->

                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

    </div>
</div>
<!--<input type='button' text='dianji' onclick="play_sound()"/>-->
<input type="hidden" id="h_c_car_id">
<input type="hidden" id="h_all_car_id">
<%- include ../taglib/layout-content.ejs %>
<script type="text/javascript">
    var table;
    $(document).ready(function () {
        table = $('.dataTables-example').dataTable({
            "lengthChange": false,//是否允许用户自定义显示数量
//            "searching": false,//本地搜索
            "scrollY": true,//dt高度
            scrollX: true,
            "autoWidth": true,//自动宽度
            "dom": '<"top"<"clear">>rt<"bottom"ilp<"clear">>',
//            "lengthChange": false,//是否允许用户自定义显示数量
            "ajax": {
                "url": "/report/outLinelist",
                "dataSrc": "rows"
            },
            serverSide: true,
            columns: [

                {"sClass": "text-center", data: null,"bSortable": false, "orderable": false},
                {"sClass": "text-center", data: 'carNo',"bSortable": false, "orderable": false},
                {"sClass": "text-center", data: 'terminalCode', "bSortable": false, "orderable": false},
                {"sClass": "text-center", data: 'sim', "bSortable": false, "orderable": false},
//                {"sClass": "text-center", data: 'userName', "bSortable": false, "orderable": false},
//                {"sClass": "text-center", data: 'runTime', "bSortable": false, "orderable": false},
//                {"sClass": "text-center", data: 'runMile', "bSortable": false, "orderable": false},
//                {"sClass": "text-center", data: 'runNum', "bSortable": false, "orderable": false},
//                {"sClass": "text-center", data: 'lineNum', "bSortable": false, "orderable": false}

            ],
            //排序
            initComplete: function (setting, json) {
                //隐藏列
                visiblecolumn(table,0,false)
            },
        });
    });
    //    隐藏列
    function visiblecolumn(table, c, visible) {
        table.DataTable().column(c).visible(visible)
    }
//    /**
//     * 树刷新数据
//     */
//    function query() {
//        search_ztree('kindTree', 'serchStr');
//    }



</script>

<script type="text/javascript">
//    $(document).ready(function () {
//
//        var start = {
//            elem: '#start',
//            format: 'YYYY-MM-DD hh:mm:ss',
////            min: laydate.now(), //设定最小日期为当前日期
//            max: '2999-06-16 23:59:59', //最大日期
////            start: laydate.now(),
////            start: laydate.now() + ' 00:00:00',
//            istime: true,
//            istoday: false,
//            festival: true, //是否显示节日
//            choose: function (datas) {
//                end.min = datas; //开始日选好后，重置结束日的最小日期
//                end.start = datas //将结束日的初始值设定为开始日
//            }
////            min: laydate.now(-1), //-1代表昨天，-2代表前天，以此类推
////            max: laydate.now(+1) //+1代表明天，+2代表后天，以此类推
//        };
//        var end = {
//            elem: '#end',
//            format: 'YYYY-MM-DD hh:mm:ss',
////            min: laydate.now(),
//            max: '2999-06-16 23:59:59',
////            start: laydate.now() + ' 23:59:59',
//            istime: true,
//            istoday: false,
//            festival: true, //是否显示节日
//            choose: function (datas) {
//                start.max = datas; //结束日选好后，重置开始日的最大日期
//            }
//        };
//        laydate(start);
//        laydate(end);
//        $("#start").val(laydate.now() + ' 00:00:00');
//        $("#end").val(laydate.now() + ' 23:59:59');
//    })

</script>
<script type="text/javascript">
    //    部门车辆树
//    var urlTree;
//    $(function () {
//        urlTree = '/tree/deptCar';
//        init_tree('id', 'parentId', 'name', fnClick);
//        loadMyTree(urlTree);
//
//    });
//    //    树节点选中
//    var fnClick = function (event, treeId, treeNode) {
//        selectTreeNode(treeNode);
//    }
//
//    //    复选框选中
//    function selectTreeNode(treeNode) {
//        var isCar = treeNode.isCar
//        if (isCar) {
//            $("#h_c_car_id").val(treeNode.id);
//        }else{
//            swal("系统提示", "请选择车辆查询!", "warning");
//
//        }
//    }

    //刷新数据
    function query() {
        var carId = $("#h_c_car_id").val();
//        var start=$("#start").val();
//        var end=$("#end").val();
//    ,{"start": star},{"end": end}
        var jsonstr = [{"carId": carId}];
        table.DataTable().search(JSON.stringify(jsonstr), false, false).draw();
    }

    function outexcel() {
//        var carId = $("#h_c_car_id").val();
//        var start=$("#start").val();
//        var end=$("#end").val();
//        var jsonstr = [{"carId": carId},{"start": start},{"end": end}];
        <!--window.open("<%= serverurl%>/report/exportCarOffExcel?carId="+carId+"&start="+start+"&end="+end)-->
        window.open("<%= serverurl%>/baseCar/exportExcelOutLine")
    }

</script>
<script type="text/javascript">

</script>
</body>
</html>
